#include<stdio.h>

int main()
{
	float ele;
	scanf("%f",&ele);
	if(0<=ele&&ele<=110) printf("%.2f A 0.00",ele*0.5);
	else if(ele<=210) printf("%.2f B %.2f",55+(ele-110)*0.55,ele-110);
	else printf("%.2f C %.2f",55+55+(ele-210)*0.7,ele-210);
	return 0;
}
